$filter-portlet-design: (
  layout-left-width: 260px,
);

@include b(filter-portlet-design) {
  @include set-component-css-var('filter-portlet-design', $filter-portlet-design);

  display: flex;
  width: 100%;
  height: 100%;

  @include e('layout-left') {
    width: getCssVar(filter-portlet-design, layout-left-width);
    background-color: getCssVar(color, bg, 0);
    border-right: 1px solid getCssVar('color', 'border');
  }

  @include e('layout-right') {
    display: flex;
    flex: 1;
    flex-direction: column;
  }
}

// 左侧内容样式
@include b(filter-portlet-design-left-content) {
  @include e('title') {
    height: getCssVar('height-control', 'default');
    padding: 0 getCssVar('spacing', 'extra-loose');
    margin: getCssVar('spacing', 'extra-tight') 0;
    font-size: getCssVar('font-size', header, 6);
    line-height: getCssVar('height-control', 'default');
  }
}

// 左侧列表样式
@include b(filter-portlet-design-left-list) {
  padding: 0;
  padding: 0 getCssVar('spacing', 'base-tight');
  margin: 0;
  margin-top: getCssVar('spacing', 'base-tight');
  font-size: getCssVar('font-size', 'regular');
  list-style: none outside none;
  color-scheme: light;
  cursor: pointer;
  visibility: visible;
  unicode-bidi: isolate;

  @include e('item') {
    height: getCssVar('height-control', 'default');
    padding: 0 getCssVar('spacing', 'base-loose');
    margin-bottom: getCssVar('spacing', 'base-tight');
    overflow: hidden;
    line-height: getCssVar('height-control', 'default');
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: getCssVar('border-radius', 'small');
    transition: background-color 0.3s, transform 0.3s;

    &:last-child {
      margin-bottom: 0;
    }

    &:hover {
      background-color: var(--ibiz-color-fill-0);
    }

    @include when('actvie') {
      color: getCssVar('color', 'primary');
      background-color: var(--ibiz-color-primary-light-default);
    }

    @include when('disabled') {
      cursor: no-drop;
      background-color: transparent;
    }
  }
}

// 右侧样式
@include b(filter-portlet-design-right-content) {
  flex: auto;
  @include e('title') {
    height: getCssVar('height-control', 'default');
    padding: 0 getCssVar('spacing', 'extra-loose');
    margin: getCssVar('spacing', 'tight') 0;
    line-height: getCssVar('height-control', 'default');
  }
}

// 右侧表单样式
@include b(filter-portlet-design-right-form) {
  padding: 0 getCssVar('spacing', 'extra-loose');

  @include e('checks') {
    position: relative;

    .el-form-item__content {
      position: static;
    }

    .el-switch {
      position: absolute;
      top: 0;
      right: 0;
    }
  }

  // 表单样式 上下布局左对齐
  .el-form-item {
    display: flex;
    flex-flow: column nowrap;
    margin-bottom: getCssVar('spacing', 'base');

    .el-form-item__label-wrap {
      margin-left: 0 !important;
    }
  }

  //  必填效验样式
  .el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label,
  .el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label {
    &::before {
      display: none;
    }

    &::after {
      margin-right: getCssVar('spacing', 'extra-tight');
      margin-left: getCssVar('spacing', 'extra-tight');
      color: var(--el-color-danger);
      content: "*";
    }
  }

  // 所有编辑器宽度需撑满
  .el-select {
    width: 100%;
  }
}

// 复选框样式
@include b(filter-portlet-design-checkbox) {

  @include e('label') {
    padding-left: getCssVar('spacing', 'tight');
  }

  @include when('only-add') {
    .el-checkbox.is-checked {
      cursor: not-allowed;

      .el-checkbox__inner {
        background-color: var(--el-checkbox-disabled-checked-input-fill);
        border-color: var(--el-checkbox-disabled-checked-input-border-color);

        &::after {
          border-color: var(--el-checkbox-disabled-checked-icon-color);
        }
      }

      .el-checkbox__label {
        color: var(--el-disabled-text-color);
        cursor: not-allowed;
      }
    }
  }

  .#{bem('icon')} {
    padding-left: getCssVar('spacing', 'tight');
  }

  .el-checkbox__label {
    display: flex;
    align-items: center;
    padding-left: 0;
  }

  .el-checkbox {
    --el-checkbox-input-border: var(--el-border-width) var(--el-border-style) var(--ibiz-color-border);
    --el-checkbox-disabled-checked-input-fill: var(--ibiz-color-border);
    --el-checkbox-text-color: var(--ibiz-color-disabled-text);
  }

  .el-checkbox__input {
    margin-right: getCssVar(spacing, tight);
  }
}

// 条件样式
@include b(filter-portlet-design-condition) {
  padding: 0 getCssVar('spacing', 'extra-loose');
  overflow: auto;
}

// 底部样式
@include b(filter-portlet-design-footer) {
  display: flex;
  justify-content: flex-end;
  padding: getCssVar('spacing', 'base') getCssVar('spacing', 'extra-loose');
}
